public class TwoArrayDemo{
    public static void main(String[] args) {
        //根据课堂练习要求初始化二维数组
        int[][] a,b,c;
        a = new int[3][];
        a[0] = new int[4];
        a[1] = new int[3];
        a[1][0] = 2;
        a[2] = new int[5];

        b = new int[4][];
        b[0] = new int[3];
        b[0][2] = 1;
        b[1] = new int[1];
        b[1][0] = 5;
        b[2] = new int[4];
        b[3] = new int[4];

        c = new int[2][3];
        for (int i = 0; i < c[1].length; i++) {
            c[1][i] = 4;
        }
        for (int i = 0; i < c.length; i++) {
            for (int j = 0; j < c[i].length; j++) {
                c[i][j] = 4;
            }
        }
        //输出查看结果
        for (int[] a1 : a){
            for (int a2 : a1){
                System.out.print(a2);
            }
            System.out.println();
        }

        for (int[] b1 : b){
            for (int b2 : b1){
                System.out.print(b2);
            }
            System.out.println();
        }

        for (int[] c1 : c){
            for (int c2 : c1){
                System.out.print(c2);
            }
            System.out.println();
        }
    }
}